Infinity and -infinity in Python
- Use float
a = float("inf") #positive infinity
b = float("-inf") #negative infinity
print(a,b)
print(12 > a)
print(12 > b)
a = float("inf") #positive infinity
b = float("-inf") #negative infinity
print(a,b)
print(12 > a)
print(12 > b)